﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using HNCDataSetTableAdapters;

public partial class Admin_Service_Service : System.Web.UI.Page
{
    CategoryTableAdapter cate = new CategoryTableAdapter();
    ProductsTableAdapter pro = new ProductsTableAdapter();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //DataTable dt = cate.GetCateByParentID(3);
            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    int CateID =int.Parse(dt.Rows[1]["CateID"].ToString());
            //    DataTable dt2 = pro.GetProductByCateID(CateID);
            //    gvProduct.DataSource = dt2;
            //    gvProduct.DataBind();
            //}
            
        }
    }
    protected void gvProduct_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        pro.DeleteProductByProductID(true, Convert.ToInt32(e.CommandArgument.ToString()));
        Response.Redirect("~/Admin/Service/Service.aspx");
    }
}